<?php
namespace wstmart\home\controller;
use Think\Db;

class Tao extends Base{
	
    public function index(){
		$request = request();
		if($request->isPost()){
			$data = $request->param();
			if(Db::name('tao')->update($data)!=false){
				$this->success('操作成功',url('tao/index'),['status'=>1]);
			}else{
				$this->success('操作失败',url('tao/index'),['status'=>'-1']);
			}
		}else{
			$rs = Db::name('tao')->where(['id'=>1])->find();
			$this->assign("object",$rs);
			return $this->fetch(":tao");
		}
    }
    /**
     * 保存目录ID
     */
    public function getMenuSession(){
    	$menuId = input("post.menuId");
    	$menuType = session('WST_USER.loginTarget');
    	session('WST_MENUID3'.$menuType,$menuId);
    } 
    /**
     * 获取用户信息
     */
    public function getSysMessages(){
    	$rs = model('Systems')->getSysMessages();
    	return $rs;
    }
    /**
     * 定位菜单以及跳转页面
     */
    public function position(){
    	$menuId = (int)input("post.menuId");
    	$menuType = ((int)input("post.menuType")==1)?1:0;
    	session('WST_MENUID3'.$menuType,$menuId);
    }
}
